﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />


	<link href="__STATIC__admin/css/admin-min.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/admin.css" />
	<link href="__STATIC__admin/iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/icheck/icheck.css" />
	<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/skin/default/skin.css" id="skin" />
	<link href="__STATIC__admin/css/admin-style.css" rel="stylesheet" type="text/css" />


<title>添加广告</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	<a href="{:U('admin/ad/index')}">广告管理</a>
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<style>
	body>.breadcrumb{padding: 0px 15px;}
	.tabCon{
		padding: 10px 0px 20px;
	}
	.page-container{
		padding-top:10px;
	}
	span>select{
		line-height: 30px;
		position: relative;
		top: -4px;
		background:none;
	}
	.row>div>.input-text{
		height:30px;
	}
</style>
<div class="page-container container">
	<form class="form form-horizontal" id="form" action="" method="post">
		<input type="hidden" id="type" name="type" value="<?php echo $data['type'];?>">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" style="width: 30%;" value="<?php echo $data['adname'];?>" placeholder="" id="" name="adname">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>有效期：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width: 30%;">
				<span class="select-box">
					<select name="timeset" class="select">
						<option <?php if($data['timeset'] == 0){echo 'selected';} ?> value="0">永不过期</option>
						<option <?php if($data['timeset'] == 1){echo 'selected';} ?> value="1">在设内时间内有效</option>
					</select>
				</span>
			</div>
		</div>
		<div class="row form-group">
			<label for="dtp_input2" class="col-md-2 control-label">开始时间:</label>
			<div class="input-group date form_date col-md-5"  id="startTime" data-date="" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
				<input class="input-text" value="<?php
				if($data['starttime']){
					echo date("Y-m-d H:i:s",$data['starttime']);
				}else{
					echo date("Y-m-d H:i:s",time());
				}

				?>" name="starttime" size="100" type="text" value="" readonly>
				<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
				<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
			</div>
			<br/>
		</div>

		<div class="row form-group">
			<label for="dtp_input2" class="col-md-2 control-label">结束时间:</label>
			<div class="input-group date form_date col-md-5"  id="endTime" data-date="" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
				<input class="input-text" name="endtime" value="<?php echo date("Y-m-d H:i:s",$data['endtime']);?>" size="100" type="text" value="" readonly>
				<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
				<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
			</div>
			<br/>
		</div>

		<div id="tab-system" class="HuiTab tab-center" style="margin-top: 20px;" >
			<div class="tabBar cl"><span>代码</span><span>文字</span><span>图片</span><span>flash</span></div>
<!--			代码 开始-->
			<div class="tabCon">

				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">代码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="type0[code]"><?php echo $data['normbody'];?></textarea>
					</div>
				</div>

			</div>
<!--			代码 结束-->
<!--			文字 开始-->
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文字：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" style="width: 30%;" value="<?php echo $data['word'];?>" placeholder="" id="" name="type1[word]">
					</div>
				</div>

				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>链接：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" style="width: 30%;" value="<?php echo $data['href'];?>" placeholder="" id="" name="type1[href]">
					</div>
				</div>

			</div>
<!--			文字 结束-->
<!--			图片 开始-->
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">图片地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['file_path'];?>" id="" name="type2[img]">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">链接地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="<?php echo $data['url'];?>" id="" name="type2[href]" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">长：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['width'];?>" id="" name="type2[width]">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">宽：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['height'];?>" id="" name="type2[height]">
					</div>
				</div>

			</div>
<!--			图片 结束-->
<!--			flash 开始-->
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">flash地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['file_path'];?>" id="" name="type3[flash]">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">链接地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="<?php echo $data['url'];?>" id="" name="type3[href]" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">长：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['width'];?>" id="" name="type3[width]">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">宽：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text"  class="input-text" value="<?php echo $data['height'];?>" id="" name="type3[heighttype3]">
					</div>
				</div>
			</div>
<!--			flash 结束-->

				
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>



<link href="__STATIC__bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="__STATIC__bootstrap/css/datetimepicker.min.css" rel="stylesheet" media="screen">

<!--<script type="text/javascript" src="__STATIC__admin/jquery/1.9.1/jquery.min.js"></script>-->
<script type="text/javascript" src="__STATIC__admin/jquery/jquery-1.8.3.min.js" charset="UTF-8"></script>
<!--<script type="text/javascript" src="__STATIC__admin/layer/2.1/layer.js"></script>-->
<script type="text/javascript" src="__STATIC__admin/icheck/jquery.icheck.min.js"></script>

<script type="text/javascript" src="__STATIC__bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__bootstrap/js/datetimepicker.min.js" charset="UTF-8"></script>

<script type="text/javascript" src="__STATIC__jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="__STATIC__jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__STATIC__jquery.validation/1.14.0/messages_zh.min.js"></script>
<script type="text/javascript" src="__STATIC__admin/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__admin/js/admin-admin.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","0");
	$('#tab-system .tabBar span').click(function(){
		var i = $(this).index();
		$('#type').val(i);
	})

	var type = <?php echo $data['type'];?>;
	$('.tabCon').hide().eq(type).show();
	$('.tabBar span').removeClass('current').eq(type).addClass('current');


});
</script>
<script>
	$('#startTime').datetimepicker({
		weekStart: 1,
		todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		forceParse: 0,
		showMeridian: 1
	});
	$('#endTime').datetimepicker({
		weekStart: 1,
		todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		forceParse: 0,
		showMeridian: 1
	});

	$(function(){

		$("#form").validate({
			rules: {
				adname: "required",
			},
			messages: {
				adname: "菜单不能为空",
			}
		});

	})

</script>

</body>
</html>